
import Cookies from 'js-cookie'
import config from '@/config'
export function setToken(params){
	console.log(params)
	if(params.remember){
		Cookies.set('token', params.token, { expires: config.tokenExpires })
	}else{
		sessionStorage.setItem('token',params.token)
	}
}
export function getToken(){
	var sessionToken=sessionStorage.getItem('token')
	var cookieToken=Cookies.get('token')
	return sessionToken||cookieToken
}
export function removeToken(){
	Cookies.remove('token')
	sessionStorage.removeItem('token')
}
